require_relative './parser'

module Stone
  class BasicInterpreter
    def initialize(lexer, parser, env)
      @lexer = lexer
      @parser = parser
      @env = env
    end

    def run
      while @lexer.peek != Lex::EOF
        ast = @parser.parse(@lexer)
        res = ast.evaluate(@env)

        puts "=> #{res}"
      end
    end
  end
end
